<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/include/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css">
    <script>
        var ctx = "${ctx}";
    </script>
</head>
<body>
<form class="layui-form" style="width: 80%;">
    <!--管理员id 这个必须要有 因为底层sql是根据id来更新的
    但是password和 status其他字段可有可无 但是类型和名称必须一样 不然会绑定错误
    ajax无法进去controller
    -->
    <input type="hidden" name="ser_num" value="${lend.ser_num}" id="ser_num"/>



    <div class="layui-form-item">
        <label class="layui-form-label">选择图书</label>
        <div class="layui-input-block">
            <select name="book_id">
                <option value="">请选择</option>
                <c:forEach items="${books}" var="r">
                    <c:if test="${lend.book_id==r.book_id}">
                        <option value="${r.book_id}" selected>${r.name}</option>
                    </c:if>
                    <c:if test="${lend.book_id!=r.book_id}">
                        <option value="${r.book_id}">${r.name}</option>
                    </c:if>
                </c:forEach>
            </select>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">选择借阅人</label>
        <div class="layui-input-block">
            <select name="user_id">
                <option value="">请选择</option>
                <c:forEach items="${users}" var="r">
                    <c:if test="${lend.user_id==r.user_id}">
                        <option value="${r.user_id}" selected>${r.realname}</option>
                    </c:if>
                    <c:if test="${lend.user_id!=r.user_id}">
                        <option value="${r.user_id}">${r.realname}</option>
                    </c:if>
                </c:forEach>
            </select>
        </div>
    </div>



    <div class="layui-form-item">
        <label class="layui-form-label">借阅日期</label>
        <div class="layui-input-inline">
            <input type="text" id="lend_date" name="lend_date" class="layui-input"
                   lay-verify="required" placeholder="请输入借阅日期" >
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">归还日期</label>
        <div class="layui-input-inline">
            <input type="text" id="back_date" name="back_date" class="layui-input"
                   lay-verify="required" placeholder="请输入归还日期" >
        </div>
    </div>


    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="updateLend">立即保存</button>
        </div>
    </div>
</form>
<script type="text/javascript" src="${ctx }/layui/layui.js"></script>
<script type="text/javascript" src="${ctx }/js/lend/editLend.js"></script>
<script type="text/javascript" src="${ctx }/js/pubilc.js"></script>
</body>
</html>















